import { Body, Controller, Get, Param, Post, Query, Headers } from '@nestjs/common';
import { LargeModelService } from './large-model.service';
import { ApiOperation, ApiTags } from '@nestjs/swagger';
import { isNoAuth } from 'src/utils/decorator/jwt.decorator';
import { TokenDto } from './dto/token.dto';
import { ResultDto } from './dto/resultDto';

@ApiTags('大模型')
@Controller('large-model')
@isNoAuth()
export class LargeModelController {
  constructor(private readonly largeModelService: LargeModelService) {}

  @ApiOperation({
    summary: '获取token',
  })
  @Get('getLargeModelToken')
  async login(@Query() params:TokenDto) {
    return await this.largeModelService.getToken(params);
  }

  @ApiOperation({
    summary: '获取答案',
  })
  @Post('getResult')
  async getResult(@Query() params: ResultDto, @Headers() header) {
    return await this.largeModelService.getResult(params, header);
  }
}
